package main

import (
	"encoding/json"
	"fmt"
)

func main() {

	var s Student = Student{Name:"小王吧",Age:26,Sex:true}

	bytes , e := json.Marshal(s)

	fmt.Println(string(bytes),e)

	var s2 Student

	err := json.Unmarshal(bytes, &s2)

	fmt.Println(err,s2)

	var m map[string]interface{}

	err2 := json.Unmarshal(bytes, &m)

	fmt.Println(err2,m)

}


type Student struct {

	Name string `json:"name"`

	Age int  `json:"age"`

	Sex bool `json:"sex,string"`
}